package UserProfile;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class Configuration {

    private String ONTOLOGY;
    private String ONTOLOGYSTEREOTYPE;
    private String DBMOVIES;
    private String DBRATINGS;
    private String DBTRAIN;
    private String DBTEST;
    private String NS;
    private String DBUSER;
    private String DBUSERS;
    private String DBPASS;
    private String DBNAME;
    private String URL;
    private String DBType;
    private String DRIVER;
    private String OUTSEMANTIC;
    private String OUTSEMANTICDISP;
    private String OUTCONTENT;
    private String OUTMOVIESNOTFOUND;
    private String OUTRECOMMENDATION;
    private String ONTOLOGYUSER;
    private String MOVIESIMDB;
    private String OUTFOLDER;
    
    private double wGenres = 1d;
    private double wActors =  1d;
    private double wWirters =  1d;
    private double wDirectors = 1d;
    private int PATH;

    private Properties database;
    private Properties ontology;
    private static Configuration instancia;
    
    public static Configuration getInstance(){
        if(instancia==null)
            instancia= new Configuration();
        return instancia;
    }
    
    private Configuration() {
        database = new Properties();
        ontology = new Properties();

        try {
            FileInputStream ont = new FileInputStream("ontology.properties");
            FileInputStream db = new FileInputStream("database.properties");

            database.load(db);
            ontology.load(ont);

            ONTOLOGY = ontology.getProperty("ontology");
            ONTOLOGYSTEREOTYPE=ontology.getProperty("ontologystereotype");
            ONTOLOGYUSER = ontology.getProperty("ontologyuser");
            MOVIESIMDB = ontology.getProperty("moviesImdb");
            NS = ontology.getProperty("ns");
            DBMOVIES = ontology.getProperty("dbmovies");
            DBRATINGS = ontology.getProperty("dbratings");
            DBUSERS = ontology.getProperty("dbusers");
            DBTRAIN = ontology.getProperty("dbtrain");
            DBTEST = ontology.getProperty("dbtest");
            OUTSEMANTIC = ontology.getProperty("outsemantic");
            OUTSEMANTICDISP = ontology.getProperty("outsemanticPorDispersion");
            OUTCONTENT = ontology.getProperty("outcontent");
            OUTMOVIESNOTFOUND = ontology.getProperty("moviesnotfound");
            OUTRECOMMENDATION = ontology.getProperty("outrecommendation");
            OUTFOLDER=ontology.getProperty("outfolder");
            PATH = new Integer(ontology.getProperty("path")).intValue();
            
            
            
            DBUSER = database.getProperty("user");
            DBPASS = database.getProperty("pass");
            DBNAME = database.getProperty("database");
            URL = database.getProperty("url");
            DBType = database.getProperty("type");
            DRIVER = database.getProperty("driver");

            db.close();
            ont.close();

        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    public String getONTOLOGY() {
        return ONTOLOGY;
    }

    public String getDBTRAIN() {
        return DBTRAIN;
    }

    public String getDBTEST() {
        return DBTEST;
    }

    public String getDBMOVIES() {
        return DBMOVIES;
    }

    public String getDBRATINGS() {
        return DBRATINGS;
    }

    public String getNS() {
        return NS;
    }

    public String getDBUSER() {
        return DBUSER;
    }

    public String getDBPASS() {
        return DBPASS;
    }

    public String getDBNAME() {
        return DBNAME;
    }

    public String getONTOLOGYUSER() {
        return ONTOLOGYUSER;
    }

    public String getMOVIESIMDB() {
        return MOVIESIMDB;
    }

    public String getURL() {
        return URL;
    }

    public String getDBType() {
        return DBType;
    }

    public String getOUTMOVIESNOTFOUND() {
        return OUTMOVIESNOTFOUND;
    }

    public String getDRIVER() {
        return DRIVER;
    }

    public String getOUTSEMANTIC() {
        return OUTSEMANTIC;
    }

    public String getOUTSEMANTICDISP() {
        return OUTSEMANTICDISP;
    }

    public String getOUTCONTENT() {
        return OUTCONTENT;
    }

    public String getOUTRECOMMENDATION() {
        return OUTRECOMMENDATION;
    }

    public int getPATH() {
        return PATH;
    }

    public double getwGenres() {
        return wGenres;
    }

    public double getwActors() {
        return wActors;
    }

    public double getwWirters() {
        return wWirters;
    }

    public double getwDirectors() {
        return wDirectors;
    }

    public String getDBUSERS() {
        return DBUSERS;
    }

    public void setDBUSERS(String DBUSERS) {
        this.DBUSERS = DBUSERS;
    }

    public String getOUTFOLDER() {
        return OUTFOLDER;
    }

    public void setOUTFOLDER(String OUTFOLDER) {
        this.OUTFOLDER = OUTFOLDER;
    }

    public void setwGenres(double wGenres) {
        this.wGenres = wGenres;
    }

    public void setwActors(double wActors) {
        this.wActors = wActors;
    }

    public void setwWirters(double wWirters) {
        this.wWirters = wWirters;
    }

    public void setwDirectors(double wDirectors) {
        this.wDirectors = wDirectors;
    }

    public String getONTOLOGYSTEREOTYPE() {
        return ONTOLOGYSTEREOTYPE;
    }
    
    
    

}
